package com.zw._04_direct;

import com.rabbitmq.client.BuiltinExchangeType;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.zw.ConnectionUtil;

public class Send {
    public static final String EXCHANGE_NAME = "exchange_name";
    public static void main(String[] args) throws Exception {
        Connection connection = ConnectionUtil.getConnection();
        Channel channel = connection.createChannel();
        channel.exchangeDeclare(EXCHANGE_NAME, BuiltinExchangeType.DIRECT);
        channel.basicPublish(EXCHANGE_NAME, "delete", null, "发给删除接口的一个消息".getBytes());
        System.out.println("消息发送成功");
    }
}
